package com.wu.client.utils;

import java.io.IOException;
import java.util.Base64;

/**
 * @author Cousin
 * @date 2025/4/7
 * @Description
 */
public class FileUtil {
    public static byte[] decodeBase64(String base64) throws IOException {
        if (base64.startsWith("data:")) {
            // 去掉 `data:[<mime_type>];base64,` 部分
            String[] parts = base64.split(",");
            base64 = parts[1];
        }
        return Base64.getDecoder().decode(base64);
    }
}
